//
//  WBComposeButton.swift
//  0829-Weibo
//
//  Created by 毕仲阳 on 16/9/6.
//  Copyright © 2016年 mycompany. All rights reserved.
//

import UIKit

class WBComposeButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    func setUI()
    {
        imageView?.contentMode = UIViewContentMode.center
        titleLabel?.textAlignment = NSTextAlignment.center
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        
        let width = self.frame.width
        let height = self.frame.height
        imageView?.frame = CGRect(x: 0, y: 0, width: width, height: width)
        titleLabel?.frame = CGRect(x: 0, y: width, width: width, height: height - width)
    }
}
